/*
 * @Author: zhouwei wei.zhou@flip.fun
 * @Date: 2024-04-26 15:54:08
 * @LastEditors: zhouwei wei.zhou@flip.fun
 * @LastEditTime: 2024-04-27 15:38:50
 * @FilePath: /redux/src/store/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createStore, combineReducers, logger, applyMiddleware, logger1 } from '../redux/index'
const reducer = (state = { num: 1 }, action) => {
	switch (action.type) {
		case 'add':
			return { ...state, num: state.num + action.payload }
		default:
			return state
	}
}
const useReducer = (state = { name: 'zw' }, action) => {
	switch (action.type) {
		case 'add':
			return { ...state, name: 'ly' }
		default:
			return state
	}
}
const store = createStore(
	combineReducers({
		store: reducer,
		use: useReducer,
	}),
	applyMiddleware(logger, logger1)
)

export default store
